x86: fix wait code asm() constraints
authorJan Beulich <jbeulich@suse.com>
Mon, 6 Aug 2012 09:18:43 +0000 (11:18 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 6 Aug 2012 09:18:43 +0000 (11:18 +0200)
commitfb95436f54cb97ff982137ed29d70f5919379a22
treef53937823834cb3de2837c26b0c88979771dacd8
parent4f6dda6a14abb5aa9337b28226518294c3300f58
x86: fix wait code asm() constraints

This fixes theoretical issues with those constraints - operands that
get clobbered before consuming all input operands must be marked so
according the the gcc documentation. Beyond that, the change is merely
code improvement, not a bug fix.

In __prepare_to_wait(), properly mark early clobbered registers. By
doing so, we at once eliminate the need to save/restore rCX and rDI.

In check_wakeup_from_wait(), make the current constraints match by
removing the code that actuall alters registers. By adjusting the
resume address in __prepare_to_wait(), we can simply re-use the copying
operation there (rather than doing a second pointless copy in the
opposite direction after branching to the resume point), which at once
eliminates the need for re-loading rCX and rDI inside the asm().

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen/common/wait.c